home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 1.4 KB | 54 lines | [TEXT/MPS ] |
- // The C++ Booch Components (Version 2.1)
- // (C) Copyright 1990-1993 Grady Booch. All Rights Reserved.
- //
- // BCStacU.h
- //
- // This file contains the declaration of the unbounded stack.
-
- #ifndef BCSTACU_H
- #define BCSTACU_H 1
-
- #include "BCUnboun.h"
- #include "BCStac.h"
-
- // Unbounded stack
-
- template<class Item, class StorageManager>
- class BC_TUnboundedStack : public BC_TStack<Item> {
- public:
-
- BC_TUnboundedStack();
- BC_TUnboundedStack(const BC_TUnboundedStack<Item, StorageManager>&);
- virtual ~BC_TUnboundedStack();
-
- virtual BC_TStack<Item>& operator=(const BC_TStack<Item>&);
- virtual BC_TStack<Item>& operator=(const BC_TUnboundedStack<Item, StorageManager>&);
- virtual BC_Boolean operator==(const BC_TStack<Item>&) const;
- virtual BC_Boolean operator==(const BC_TUnboundedStack<Item, StorageManager>&) const;
- BC_Boolean operator!=(const BC_TUnboundedStack<Item, StorageManager>&) const;
-
- virtual void Clear();
- virtual void Push(const Item&);
- virtual void Pop();
-
- virtual BC_Index Depth() const;
- virtual BC_Boolean IsEmpty() const;
- virtual const Item& Top() const;
- virtual Item& Top();
-
- static void* operator new(size_t);
- static void operator delete(void*, size_t);
-
- protected:
-
- BC_TUnbounded<Item, StorageManager> fRep;
-
- virtual void Purge();
- virtual void Add(const Item&);
- virtual BC_Index Cardinality() const;
- virtual const Item& ItemAt(BC_Index) const;
-
- };
-
- #endif
-